home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / QuickDraw3D 1.6 SDK / Mac SampleCode New for 1.6 / CompressedPixmapSample / Headers / QD3D_Support.h < prev   
Encoding:
Text File  |  1999-05-18  |  2.4 KB  |  110 lines  |  [TEXT/CWIE]

  1. //
  2. // qd3d_support.h
  3. //
  4.  
  5. #ifndef QD3D_SUP
  6. #define QD3D_SUP
  7.  
  8.  
  9.  
  10. #include <QD3D.h>
  11. #include <QD3DCamera.h>
  12. #include <QD3DDrawContext.h>
  13. #include <QD3DRenderer.h>
  14. #include <QD3DShader.h>
  15. #include <QD3DStyle.h>
  16. #include <QD3DView.h>
  17.  
  18.  
  19. #define    DEFAULT_FPS            3
  20.  
  21. #define    MAX_FILL_LIGHTS        4
  22.  
  23. typedef    struct
  24. {
  25.     WindowPtr                displayWindow;
  26.     TQ3ObjectType            rendererType;
  27.     TQ3ColorARGB            clearColor;
  28.     Rect                    paneClip;            // not pane size, but clip:  left = amount to clip off left
  29. }QD3DViewDefType;
  30.  
  31.  
  32. typedef    struct
  33. {
  34.     TQ3InterpolationStyle    interpolation;
  35.     TQ3BackfacingStyle        backfacing;
  36.     TQ3FillStyle            fill;
  37.     TQ3ObjectType            illuminationType;
  38. }QD3DStyleDefType;
  39.  
  40.  
  41. typedef struct
  42. {
  43.     TQ3Point3D                from;
  44.     TQ3Point3D                to;
  45.     TQ3Vector3D                up;
  46.     float                    hither;
  47.     float                    yon;
  48.     float                    fov;
  49. }QD3DCameraDefType;
  50.  
  51. typedef    struct
  52. {
  53.     float            ambientBrightness;
  54.     TQ3ColorRGB        ambientColor;
  55.     long            numFillLights;
  56.     TQ3Vector3D        fillDirection[MAX_FILL_LIGHTS];
  57.     TQ3ColorRGB        fillColor[MAX_FILL_LIGHTS];
  58.     float            fillBrightness[MAX_FILL_LIGHTS];
  59. }QD3DLightDefType;
  60.  
  61.  
  62.         /* QD3DSetupInputType */
  63.         
  64. typedef struct
  65. {
  66.     QD3DViewDefType            view;
  67.     QD3DStyleDefType        styles;
  68.     QD3DCameraDefType        camera;
  69.     QD3DLightDefType        lights;
  70. }QD3DSetupInputType;
  71.  
  72.  
  73.         /* QD3DSetupOutputType */
  74.  
  75. typedef struct
  76. {
  77.     TQ3ViewObject            viewObject;
  78.     TQ3ShaderObject            shaderObject;
  79.     TQ3StyleObject            interpolationStyle;
  80.     TQ3StyleObject            backfacingStyle;
  81.     TQ3StyleObject            fillStyle;
  82.     TQ3CameraObject            cameraObject;    // another ref is in viewObject, this one's just for convenience!
  83.     TQ3GroupObject            lightGroup;        // another ref is in viewObject, this one's just for convenience!
  84.     TQ3DrawContextObject    drawContext;    // another ref is in viewObject, this one's just for convenience!
  85.     WindowPtr                window;
  86.     Rect                    paneClip;            // not pane size, but clip:  left = amount to clip off left
  87. }QD3DSetupOutputType;
  88.  
  89.  
  90. //===========================================================
  91.  
  92. extern    void QD3D_SetupWindow(QD3DSetupInputType *setupDefPtr, QD3DSetupOutputType *outputPtr);
  93. extern    void QD3D_DisposeWindowSetup(QD3DSetupOutputType *data);
  94. extern    void QD3D_ChangeDrawSize(QD3DSetupOutputType *setupInfo);
  95. extern    void QD3D_DrawScene(QD3DSetupOutputType *setupInfo, void (*drawRoutine)(QD3DSetupOutputType *));
  96. extern    float    QD3D_CalcFramesPerSecond(void);
  97. extern    Boolean QD3D_ShowError(Str255 errString, Boolean showWarnings);
  98.  
  99. extern    void QD3D_ShowRecentError(void);
  100. extern    void QD3D_DoMemoryError(void);
  101.  
  102.  
  103.  
  104.  
  105. #endif
  106.  
  107.  
  108.  
  109.  
  110.